<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="pt" xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sec="http://www.springframework.org/security/facelets/tags"
	xmlns:p="http://primefaces.org/ui">
<ui:composition template="/templates/homeGerente.xhtml">
	<ui:define name="corpo">
		<h:form id="formCad">
			<div align="center">
				<h:panelGrid columns="1">
					<div class="user" align="center">
						<h:outputLabel value="Descrição do Publico Alvo" />
						 <p:keyboard value="#{publicoAlvoMB.entity.publicoAlvo}"/>  
					</div>
					<p:commandButton value="Salvar"
						action="#{publicoAlvoMB.saveOrUpdate}" ajax="false"/>
					<p:commandButton value="Listar" ajax="false"
						action="#{publicoAlvoMB.list}" update="listPanel" />
				</h:panelGrid>
			</div>
		</h:form>
		<h:form>
			<p:dataTable rendered="#{publicoAlvoMB.listing}" id="listPanel"
				value="#{publicoAlvoMB.listEntity}" var="publicos" rows="5"
				emptyMessage="Vazio" paginator="true">
				<p:column headerText="Descrição">
					<h:outputText value="#{publicos.publicoAlvo}" />
				</p:column>
				<p:column headerText="Editar">
					<p:commandLink action="#{publicoAlvoMB.editar}" ajax="false">
						<f:setPropertyActionListener target="#{publicoAlvoMB.entity}"
							value="#{publicos}" />
						<p:graphicImage
							value="#{pageContext.servletContext.contextPath}/images/editar.png"
							title="Editar" />
					</p:commandLink>
				</p:column> 
				<p:column headerText="Deletar">
					<p:commandLink action="#{publicoAlvoMB.delete}" ajax="false" >
						<p:graphicImage
							value="#{pageContext.servletContext.contextPath}/images/lixeira.png"
							title="Deletar" />
						<f:setPropertyActionListener target="#{publicoAlvoMB.entity}"
							value="#{publicos}" />
					</p:commandLink>
				</p:column>
			</p:dataTable>
		</h:form>
	</ui:define>
</ui:composition>
</html>